_[66]={
	onchange:function(x){
	},
	ondrawitem:function(x){
	},
	ondrawoverlay:function(x){
	},
	pagedown:function(){
	},
	pageup:function(){
	},
	reset:function(fetch){
		if(fetch)
			this._L(1);
		else{
			var i,q,r=this._r,s=[];
			s.push('<dl>');
			for(i=0,q=r.length;i<q;){
				var e=r[i++];
				s.push('<dd><img src=');
				s.push(e._);
				s.push('><div class=s66n r=');
				s.push(e.r);
				s.push('></div>');
			}
			s.push('</div>');
			this._d.innerHTML=s.join('');
			this._d.scrollTop=0;
			this._p=0;
		}
	},
	select:function(cells){
	},
	src:null,

	_:function(d){
		this._d=d;
		this._g=d.getAttribute('storage');
		var r=localStorage.getItem(this._g);
		if(r)
			this._r=JSON.parse(r);
		this._A('click','_E');
		this._A('touchend','_E');
		this._A('touchmove','_M');
		this._A('touchstart','_S');
		this._L();
	},

	_d:null,	// dom node
	_g:null,	// storage
	_r:[{k:0}],	// image set

	_A:function(e,f){
		var o=this;
		this._d.addEventListener(e,function(v){return o[f](v);},false);
	},
	_E:function(e){		// click, touchend
		var a=e.target,c=a.className;
		if(c){
			a.className=c=='s66m'?'s66n':'s66m';
			this.onchange(a);
		}
		e.preventDefault();
	},
	_M:function(e){		// touchmove
		e.stopPropagation();
	},
	_L:function(refresh){		// load
		var o=this,x=new XMLHttpRequest(),z=refresh?0:o._r[0].k;
		x.timeout=10000;
		x.onreadystatechange=function(e){
			if(x.readyState==4){
				if(x.status==200){
					var r=JSON.parse(x.responseText);
					if(r[0].k>z){
						localStorage.setItem(o._g,JSON.stringify(r));
						o._r=r;
					}
				}
				o.reset(0);
			}
		}
		x.open('GET',o._d.getAttribute('cells')+'?k='+z,true);
		x.send();
	},
	_S:function(e){		// touchstart
		var d=this._d;
		var o=d.scrollTop;
		var h=d.scrollHeight;
		if(o<1)
			d.scrollTop=1;
		if(o+d.offsetHeight>=h)
			d.scrollTop=h-d.offsetHeight-1;
	},
}